package com.frog.rss.service;

import java.util.List;

import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Message;

import com.frog.chinanews.Constant;
import com.frog.chinanews.MainActivity.GetNewRssHandler;
import com.frog.rss.domain.RSSItem;
import com.frog.rss.facade.RSSFacade;

public class LoadRSSItemsSerivce extends Service {
	RSSFacade rssFacade = new RSSFacade();

	@Override
	public void onCreate() {
		super.onCreate();
		List<RSSItem> rssItems = rssFacade
				.loadRSSItemsFromWWW(Constant.FEED_URL);
		rssFacade.saveRSSItemsToDB(LoadRSSItemsSerivce.this, rssItems);
		// GetNewRssHandler handler = new GetNewRssHandler();
		// Message msg = handler.obtainMessage();
		// Bundle b = new Bundle();
		// b.putString("status", "updated");
		// msg.setData(b);
		// handler.sendMessage(msg);
	}

	@Override
	public IBinder onBind(Intent arg0) {
		return null;
	}

}
